import 'package:flutter_app/util/client.dart';

//void main() async {
//  var s = await Client.get("http://wxapp.qqvbc.com/crab/v2/search");
//  print(s['data']['data'][0]['id']);
//}

class Person {
  String firstName;

  Person.fromJson(Map data) {
    print('in Person');
  }
}

class Employee extends Person {
  // 父类没有无参数的非命名构造函数，必须手动调用一个构造函数
  //super.fromJson(data)
  Employee.fromJson(Map data) : super.fromJson(data) {
    print('in Employee');
  }
}

main() {
  var emp = new Employee.fromJson({});

  // Prints:
  // in Person
  // in Employee
  if (emp is Person) {
    // Type check
    emp.firstName = 'Bob';
  }
  (emp as Person).firstName = 'Bob';
}
